home *** CD-ROM | disk | FTP | other *** search
/ Internet.Works 40 / Issue 40.iso / pc / PCSoftware / HTML Tool 3.5 / htmltool.exe / _SETUP.1 / Delayed popup.scp < prev    next >
Encoding:
Text File  |  2000-03-06  |  1.1 KB  |  36 lines

  1. <HTMLtool>Open a popup window, delayed</HTMLtool>
  2.  
  3. <!-- TWO STEPS TO INSTALL DELAYED POPUP:
  4.  
  5.   1.  Copy the coding into the HEAD of your HTML document
  6.   2.  Add the onLoad event handler into the BODY tag  -->
  7.  
  8. <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  9.  
  10. <HEAD>
  11.  
  12. <SCRIPT LANGUAGE="JavaScript">
  13.  
  14. <!-- Begin
  15. closetime = 0; // Close window after __ number of seconds?
  16. // 0 = do not close, anything else = number of seconds
  17.  
  18. function Start(URL, WIDTH, HEIGHT) {
  19. windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT;
  20. preview = window.open(URL, "preview", windowprops);
  21. if (closetime) setTimeout("preview.close();", closetime*1000);
  22. }
  23.  
  24. function doPopup() {
  25. url = "http://javascript.internet.com/navigation/delayed-popup-window.html";
  26. width = 267;  // width of window in pixels
  27. height = 103; // height of window in pixels
  28. delay = 2;    // time in seconds before popup opens
  29. timer = setTimeout("Start(url, width, height)", delay*1000);
  30. }
  31. //  End -->
  32. </script>
  33.  
  34. <!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->
  35.  
  36. <BODY OnLoad="doPopup();">